﻿using AutoMapper;
using Enferno.Public.Web.Components.Server.ViewModels;
using Enferno.Public.Web.Models;

namespace Enferno.Public.Web.Components.Server.Mappers
{
    public class CheckoutModelToCheckoutViewModelProfile : Profile
    {
        protected override void Configure()
        {
            //CheckoutModel -> CheckoutViewModel
            //Mapper.CreateMap<CheckoutModelBase, CheckoutViewModelBase>()
            //    .Include<CompanyCheckoutModel, CompanyCheckoutViewModel>()
            //    .Include<PrivateCheckoutModel, PrivateCheckoutViewModel>();

            Mapper.CreateMap<CompanyCheckoutModel, CompanyCheckoutViewModel>();
            Mapper.CreateMap<PrivateCheckoutModel, PrivateCheckoutViewModel>();


            //CheckoutPayerModel -> CheckoutPayerViewModel
            Mapper.CreateMap<CheckoutPayerModel, CheckoutPayerViewModel>()
                .Include<CheckoutCompanyPayerModel, CheckoutCompanyPayerViewModel>()
                .Include<CheckoutPrivatePayerModel, CheckoutPrivatePayerViewModel>();

            Mapper.CreateMap<CheckoutCompanyPayerModel, CheckoutCompanyPayerViewModel>();
            Mapper.CreateMap<CheckoutPrivatePayerModel, CheckoutPrivatePayerViewModel>();

            //CheckoutPayerViewModel -> CheckoutPayerModel
            Mapper.CreateMap<CheckoutPayerViewModel, CheckoutPayerModel>()
                .Include<CheckoutCompanyPayerViewModel, CheckoutCompanyPayerModel>()
                .Include<CheckoutPrivatePayerViewModel, CheckoutPrivatePayerModel>();

            Mapper.CreateMap<CheckoutCompanyPayerViewModel, CheckoutCompanyPayerModel>();
            Mapper.CreateMap<CheckoutPrivatePayerViewModel, CheckoutPrivatePayerModel>();


            //CheckoutShipToModel -> CheckoutShipToViewModel
            Mapper.CreateMap<CheckoutShipToModel, CheckoutShipToViewModel>()
                .Include<CheckoutCompanyShipToModel, CheckoutCompanyShipToViewModel>()
                .Include<CheckoutPrivateShipToModel, CheckoutPrivateShipToViewModel>();

            Mapper.CreateMap<CheckoutCompanyShipToModel, CheckoutCompanyShipToViewModel>();
            Mapper.CreateMap<CheckoutPrivateShipToModel, CheckoutPrivateShipToViewModel>();

            //CheckoutShipToViewModel -> CheckoutShipToModel
            Mapper.CreateMap<CheckoutShipToViewModel, CheckoutShipToModel>()
                .Include<CheckoutCompanyShipToViewModel, CheckoutCompanyShipToModel>()
                .Include<CheckoutPrivateShipToViewModel, CheckoutPrivateShipToModel>();

            Mapper.CreateMap<CheckoutCompanyShipToViewModel, CheckoutCompanyShipToModel>();
            Mapper.CreateMap<CheckoutPrivateShipToViewModel, CheckoutPrivateShipToModel>();

            //CheckoutBuyerModel -> CheckoutBuyerViewModel
            Mapper.CreateMap<CheckoutBuyerModel, CheckoutBuyerViewModel>();

            //CheckoutBuyerViewModel -> CheckoutBuyerModel
            Mapper.CreateMap<CheckoutBuyerViewModel, CheckoutBuyerModel>();

        }
    }
}
